home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1986 April / 1986-04.d64 / dir filer (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  155 lines

  1. 10 n$="zz":poke53281,0:poke53280,0:nr=214:nc=211:kb=198:poke808,225
  2. 20 goto470
  3. 30 pokenr,1:print:print"[159]are you sure? (y/n)"
  4. 40 pokekb,0
  5. 50 getk$:ifk$=""then50
  6. 60 pokekb,0:return
  7. 70 gosub100:pokenr,1:print:print"[159]*** working ****    ":return
  8. 80 pokenr,1:print"[159]":printmid$(m$,4,16):return
  9. 90 m$="":pokenr,1:print:print"                              ":gosub120:return
  10. 100 pokenr,rl+2:print:printtab(cl*20);"[158]"mid$(n$(rl+(i+1)*cl+d-1),4,16)
  11. 110 return
  12. 120 pokenr,r+2:print:printtab(c*20);"[159]";mid$(n$(r+(i+1)*c+d-1),4,16)
  13. 130 return
  14. 140 print"[147][158]"he$;
  15. 150 ifd>1thenpokenc,21:print" p = prior screen "
  16. 160 ifd=<n-40thenpokenc,21:print" n = next screen  "
  17. 170 i=int((n-d-1)/2+.5):ifi>19theni=19
  18. 180 gosub80:pokenr,3:print"[158]"
  19. 190 forx=dtod+i
  20. 200 printmid$(n$(x),4,16)",";
  21. 210 printt$(asc(n$(x))andnot248);
  22. 220 if(asc(n$(x))and64)=64thenprint"<";
  23. 230 ifasc(n$(x+i+1)+chr$(0))=0then280
  24. 240 printtab(20);mid$(n$(x+i+1),4,16)",";
  25. 250 printt$(asc(n$(x+i+1))andnot248);
  26. 260 if(asc(n$(x+i+1))and64)=64thenprint"<";
  27. 270 print
  28. 280 next:ifr>ithenr=i+1
  29. 285 ifr>ithenr=i
  30. 290 gosub120:return
  31. 300 gosub40:cl=c:rl=r
  32. 310 ifk$=chr$(13)ork$="[133]"ork$="-"ork$=","ork$=" "ork$=""thenreturn
  33. 320 ifk$=""thenr=1:c=0
  34. 330 ifk$=""ork$="[157]"thenc=notcand1
  35. 340 ifk$=""ork$="[145]"thenr=(r+1+2*(k$>""))
  36. 350 ifc>n-1thenr=1:c=0
  37. 360 ifr>i+1thenr=1
  38. 370 ifr<1thenr=i+1
  39. 380 ifn$(r+(i+1)*c+d-1)=""then330
  40. 390 if(cl<>c)or(rl<>r)thengosub100:gosub120
  41. 400 ifk$="p"andd>1thend=d-40:gosub140
  42. 410 ifk$="n"andd=<n-40thend=d+40:gosub140
  43. 420 goto300
  44. 430 pokenr,7:print:print"   [158]are you sure? (y/n)    "
  45. 440 gosub40:ifk$="y"then1440
  46. 450 ifk$=""then440
  47. 460 return
  48. 470 print"[147][159][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]
  49. 480 [153]"peek     sysdirectory fileropen      peek"
  50. 490 [153]"peek                          peek"
  51. 500 [153]"peek sysinsert diskette in driveopen peek"
  52. 510 [153]"mid$tantantantantantantantantantantantantantantantantantantantantantantantantantan(NULL)
  53. 520 forx=1to6:n$=n$+n$:next
  54. 530 n$=mid$(n$,2):n$=n$+n$
  55. 540 forx=828to861
  56. 550 ready:pokex,y:next
  57. 560 forx=1to30:z$=z$+chr$(0):next
  58. 570 dimn$(144),s(18),t$(4):d=1:n=0:f=0:b=1:r=1:c=0
  59. 580 forx=0to17:ready:s(x)=y:next
  60. 590 t$(1)="s":t$(2)="p":t$(3)="u":t$(4)="r"
  61. 600 ln$=chr$(130)+chr$(18)+chr$(18)+"----------------"+left$(z$,11)
  62. 610 print"[213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
  63. 620 print"[194] [158]press return[146] to continue[159] [194]"
  64. 630 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
  65. 640 gosub40:ifk$=""thengosub430
  66. 650 pokenr,7:print:print"    [158]reading disk name     "
  67. 660 open15,8,15,"i0":open1,8,3,"$"
  68. 670 sys828:input#15,en$,em$:ifen$="00"then710
  69. 680 pokenr,7:print
  70. 690 print"   [158]disk read error # "en$"  "
  71. 700 print:goto1480
  72. 710 he$=mid$(n$,143,16)+","+mid$(n$,161,2)
  73. 720 pokenr,3:print:print"   "he$"    "
  74. 730 pokenr,7:print:print"    reading entry #"n"  "
  75. 740 sys828:forx=1to254step32:y=asc(mid$(n$,x,1))and127
  76. 750 ify=0then770
  77. 760 n=n+1:n$(n)=mid$(n$,x,30)
  78. 770 pokenr,7:print:pokenc,20:printn
  79. 780 next
  80. 790 ifst=0then730
  81. 800 print"[145]    total entries ="
  82. 810 forx=1to1500:next
  83. 820 close1
  84. 830 m$="":gosub140
  85. 840 gosub300:f=r+(i+1)*c+d-1
  86. 850 ifk$="-"then990
  87. 860 ifk$=" "andn>1then1040
  88. 870 ifk$=","then1120
  89. 880 ifk$=""then1190
  90. 890 ifk$="[133]"then1230
  91. 900 m$=n$(f):gosub80
  92. 910 gosub300:t=r+(i+1)*c+d-1
  93. 920 iff=t-1orf=tthengosub90:goto840
  94. 930 gosub70
  95. 940 iff>tthenv=-1
  96. 950 iff<tthenv=1:t=t-1
  97. 960 n$(f)=n$(f+v):f=f+v:iff<>tthen960
  98. 970 n$(t)=m$
  99. 980 goto830
  100. 990 gosub70:b=0
  101. 1000 n=n+1:forx=ntof+1step-1
  102. 1010 n$(x)=n$(x-1):next
  103. 1020 n$(f)=ln$
  104. 1030 goto830
  105. 1040 gosub30:ifk$<>"y"thengosub90:goto840
  106. 1050 gosub70:b=0
  107. 1060 n=n-1:forx=fton
  108. 1070 n$(x)=n$(x+1):next
  109. 1080 n$(n+1)=""
  110. 1090 ifn<c+1thenc=0
  111. 1100 iff=n+1thenr=r+(r>1)
  112. 1110 goto830
  113. 1120 a=asc(n$(f))
  114. 1130 ifa=130thena=194:goto1150
  115. 1140 ifa=194thena=130
  116. 1150 n$(f)=chr$(a)+right$(n$(f),29)
  117. 1160 pokenr,rl+2:print:printtab(cl*20+18);
  118. 1170 print"[158]"chr$(-60*(a=194));chr$(-32*(a=130))
  119. 1180 goto840
  120. 1190 gosub100
  121. 1200 gosub30:ifk$="y"then1440
  122. 1210 ifk$=""then1200
  123. 1220 gosub90:goto840
  124. 1230 gosub100:gosub30:ifk$<>"y"thengosub90:goto840
  125. 1240 pokenr,1:print:print"[159]writing directory  "
  126. 1250 ifn/8=int(n/8)then1270
  127. 1260 n=n+1:n$(n)=z$:goto1250
  128. 1270 s=0:t=18:s(n/8+.5)=255:n=1:open2,8,2,"#"
  129. 1280 ifs(s+1)=255thent=0
  130. 1290 print#15,"b-p";2;0
  131. 1300 print#2,chr$(t);chr$(s(s+1));:p=2
  132. 1310 forx=nton+7:print#15,"b-p";2;p
  133. 1320 print#2,n$(x);:p=p+32:next:n=x
  134. 1330 print#15,"u2";2;0;18;s(s):input#15,en$,em$:ifen$="00"then1370
  135. 1340 pokenr,1:print
  136. 1350 print"[159] disk write error # "en$
  137. 1360 fort=1to2000:next:goto1440
  138. 1370 s=s+1:ifs(s)<>255goto1280
  139. 1380 ifbthen1410
  140. 1390 print#2,chr$(0);chr$(255);z$:print#15,"u2";2;0;18;18
  141. 1400 pokenr,1:print:print"[159]validating bam    ":print#15,"v0"
  142. 1410 close2:print#15,"i0":close15
  143. 1420 pokenr,1:print:print"[159]another disk? (y/n)"
  144. 1430 gosub40:ifk$="y"thenrun
  145. 1440 print"[147]":pokenr,7:print
  146. 1450 print"[159][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
  147. 1460 print"[194]    [158]program terminated    [159][194]"
  148. 1470 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
  149. 1480 close1:close2:close15
  150. 1490 sys 65418
  151. 1500 data 160,2,177,45,153,137,0,200,192,6,208,246,162
  152. 1510 data 1,32,198,255,32,228,255,164,142,145,140,200
  153. 1520 data 132,142,196,139,208,242,76,204,255
  154. 1530 data 1,4,7,10,13,16,2,5,8,11,14,17,3,6,9,12,15,18
  155.